<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>点餐菜单</title>
    <link href="/webjars/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
    <script src="webjars/jquery/3.0.0/jquery.min.js"></script>
    <script src="webjars/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container p-5">

    <div class="card">
        <div class="card-header">
            您的用户编号为
            <h1 id="userIdShowArea" th:text="${uid}"></h1>

        </div>

        <div class="card-body">

            <table class="table  table-hover">
                <thead class="table-dark">
                <tr>
                    <th>菜名</th>
                    <th>价格</th>
                    <th></th>
                </tr>
                </thead>
                <tr th:each="food : ${menuList}">
                    <td th:text="${food.mName}"></td>
                    <td th:text="${food.mPrice}"></td>
                    <td><a th:href="@{'/addmyshoppingcart?mid='+${food.mId}+'&page='+${current}}">选择</a></td>
                </tr>

                <tr>
                    <td colspan="3">已点菜品：
                        <div th:text="${cart}"></div>
                    </td>
                </tr>
                <tr>
                    <!--        <td>-->
                    <!--            <input id="text" type="hidden" th:value="${cart}" />-->
                    <!--            <button type="button" onclick="send()" >提交订单</button>-->
                    <!--        </td>-->
                    <td colspan="3">
                        <input type="hidden" id="text" value="alert background someone has order food!"/>
                        <a th:href="@{'/finishorder.do?order='+${cart}+'&uid='+${uid}}" th:value="${cart}" id="submit">提交订单</a>
                    </td>
                </tr>
            </table>
            <!--<div>-->
            <!--    <input id="text" type="hidden" value="i_finished"/>-->
            <!--    <button onclick="send()">发送消息</button>-->
            <!--    <hr/>-->
            <!--    <button onclick="closeWebSocket()">关闭WebSocket连接</button>-->
            <!--    <hr/>-->
            <!--</div>-->
        </div>

        <div class="card-footer">
            点餐系统菜单105
            <div class="btn-group offset-6">
                <button class="btn-block">
                    <a class="" th:href="@{'/foodmenu.last?page='+${current -1}+'&size=5'}"> << </a>
                </button>

                <button class="number-button">
                    <span class="number-button" th:text="${current +1}"></span>
                </button>

                <button class="number-button">
                    <a class="" th:href="@{'/foodmenu.next?page='+${current +1}+'&size=5'}" th:text="${current +2}"></a>
                </button>

                <button class="btn-block">
                    <a class="" th:href="@{'/foodmenu.next?page='+${current +1}+'&size=5'}"> >> </a>
                </button>
            </div>
        </div>
    </div>
</div>

</body>

</html>